\documentclass[]{beamer}

%\documentclass[handout]{beamer}
\usepackage{pgf,pgfpages}
%\pgfpagesuselayout{2 on 1}[a4paper, portrait, border shrink=0.5in]

\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{ulem}
\usepackage{units}
\usepackage{epigraph}		% nice format for quotes
\usepackage{verbatim}		% write verbatim text
\usepackage{listings}		% include source code
\usepackage{hyperref}		% include url links

% add graphics path
\graphicspath{{figs/}}
%-----------------------

% set the listing language to python
\lstset{language=Python}


\mode<presentation>
{
  \usetheme{ift}
  \setbeamercovered{transparent}
  \setbeamertemplate{items}[square]
}

\usefonttheme[onlymath]{serif}
\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries}
\setbeamerfont{title}{size=\LARGE,series=\bfseries}

\beamertemplatenavigationsymbolsempty

\defbeamertemplate{enumerate item}{mycircle}
{
  \begin{pgfpicture}{0ex}{0ex}{1.5ex}{0ex}
    \pgfbox[center,base]{\color{uibg}\insertenumlabel.}
  \end{pgfpicture}%
}
[action]
{\setbeamerfont{item projected}{size=\scriptsize}}
\setbeamertemplate{enumerate item}[mycircle]
%
% Set title, author, date and affiliation (for the title page)
%
\title{\color{black}Python Intro Course}
\author{Lene S{\ae}len}
\date{\color{black}September 6, 2011}
\institute{Department of Physics and Technology, UiB }
%
% Begin the document
%
\begin{document}
%
% Define a new command for setting the background (uib template)
%
\newcommand{\setuibbackground}{
\setbeamertemplate{background}
{\includegraphics[width=1.0005\paperwidth,height=\paperheight]{slide_bg}}}
%
%
%***********************************************************************
% This is the title page 
%***********************************************************************
% Set the background for the title page
\setbeamertemplate{background}
 {\includegraphics[width=1.0005\paperwidth,height=\paperheight]{frontpage_bg}}
% no footer 
\setbeamertemplate{footline}[default]

\begin{frame}[label=title]
  \titlepage
  \vspace{2cm}
\end{frame}


%***********************************************************************
%
% Activate the regular uib background 
% Insert uib-footer showing the section and slide number
%
\setuibbackground
\setbeamertemplate{footline}[ifttheme]
%
%***********************************************************************


%***********************************************************************
% Python
%***********************************************************************
\begin{frame}
    \frametitle{Python}

	\begin{itemize}
        \item Python is an easy, powerful and free programming language.
        \item Similar to Matlab (but better and free)
	\end{itemize}

\end{frame}

%***********************************************************************
% Getting Python
%***********************************************************************
\begin{frame}
    \frametitle{Getting started}

	\begin{itemize}
        \item  
        \item PyScripter (Windows) [IDE], \url{http://code.google.com/p/pyscripter/}
	\end{itemize}

\end{frame}


%***********************************************************************
% 
%***********************************************************************
\begin{frame}
    \frametitle{Important}

	\begin{itemize}
        \item Python uses indentation to block code. No begin/end or curly braces.
            \begin{itemize}
                \item Indenting starts a block
                \item Unindenting ends the block
            \end{itemize}
        \item Indices start at 0 (Matlab indices start at 1)
	\end{itemize}

\end{frame}

%***********************************************************************
% Resources
%***********************************************************************
\begin{frame}
    \frametitle{Resources}
	\begin{itemize}
        \item Online Tutorial, \url{http://docs.python.org/release/2.5.2/tut/tut.html}
        \item Python Standard Library, \url{http://docs.python.org/library/index.html}
        \item Think Python [book], \url{http://greenteapress.com/thinkpython/thinkpython.html}
        \item A Byte of Python [book], \url{http://www.swaroopch.com/notes/Python}
        \item Beginners Guide [with links], \url{http://wiki.python.org/moin/BeginnersGuide}
        \item Online video tutorials [see Computer Science], \url{http://www.khanacademy.org/}
        \item Matplotlib (plotting), \url{http://matplotlib.sourceforge.net/index.html}
	\end{itemize}

\end{frame}

%***********************************************************************
% Some basics
%***********************************************************************
\begin{frame}[fragile]
    \frametitle{Some basics}
    \begin{itemize}
        \item Less talk, more doing.
        \item Real time examples of some basic python stuff:
    \end{itemize}

	\begin{enumerate}
        \item Lists
        \item Data types
        \item Range
        \item Loops
        \item Strings
        \item Modules
        \item Writing a program / function
        \item Reading data files
	\end{enumerate}

\end{frame}


%***********************************************************************
% Exercise - Fibonacci
%***********************************************************************
\begin{frame}[fragile]
    \frametitle{Exercise}
    \begin{itemize}
        \item The Fibonacci sequence: $\{F\} = 0,1,1,2,3,5,8,13,21,35,\ldots$
    \end{itemize}

	\begin{enumerate}
        \item Write a function, \texttt{fibonacci(n)} which returns the nth element of the Fibonacci sequence
            \begin{verbatim}
                fibonacci(1) = 1
                fibonacci(2) = 1
                fibonacci(6) = 8
            \end{verbatim}
        \item Write a recursive Fibonacci function
        \item Which way is better and why?
	\end{enumerate}

\end{frame}

%***********************************************************************
% Exercise - Sorting function 
%***********************************************************************
\begin{frame}[fragile]
    \frametitle{Exercise}
	\begin{itemize}
        \item Write a sorting function that will sort a given list. The program should accomplish the following:
            \begin{verbatim}
                a = [7,1,3,5,2,8]
                my_sort(a)
                print a
                [1,2,3,5,7,8]
            \end{verbatim}
        \item Try using the function \texttt{enumerate}
	\end{itemize}

\end{frame}

%***********************************************************************
% 
%***********************************************************************
\begin{frame}
    \frametitle{}
	\begin{itemize}
        \item More exercises at \url{http://code.google.com/p/master-101/downloads/list}
	\end{itemize}

\end{frame}


\end{document}
